# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=networkminer
_pkgname=NetworkMiner
pkgver=3.1
pkgrel=1
pkgdesc='A Network Forensic Analysis Tool for advanced Network Traffic Analysis, sniffer and packet analyzer.'
arch=('any')
groups=('blackarch' 'blackarch-forensic' 'blackarch-sniffer')
url='http://www.netresec.com/'
license=('GPL2')
depends=('mono' 'xterm')
_srcname="NetworkMiner_${pkgver//\./-}"
source=("$pkgname-$pkgver.zip::https://download.netresec.com/networkminer/${_pkgname}_${pkgver//./-}.zip"
        "$pkgname.desktop")
sha512sums=('8fb64a4ee697b5a0c97c0a280f8e197b510f6d6fe38d316e23d86efaa0df8a5cec01c83541b56eb43e0c699bb94bf9fa42a0d7aabcf13f18e3f5ec1b44bc1944'
            '335f559232174274259207c039f362c59c80ab0e1eef0c58b5d09692841afb7fe92563bc40cd41bd68f7a7c7c630decd0cc1f242bc2bfe0f1e18ff7264b38be1')

package() {
  cd "${_pkgname}_${pkgver//\./-}"

  install -dm 755 "$pkgdir/usr/bin"
  install -dm 755 "$pkgdir/usr/share/$pkgname"

  cp -a * "$pkgdir/usr/share/$pkgname/"

  cat > "$pkgdir/usr/bin/$pkgname" << EOF
#!/bin/sh
TERM=xterm mono /usr/share/$pkgname/NetworkMiner.exe
EOF

  install -Dm 644 "$srcdir/$pkgname.desktop" \
    "$pkgdir/usr/share/applications/$pkgname.desktop"

  chmod +x "$pkgdir/usr/bin/$pkgname"
}

